import commonService from 'service/common'
export default {
    //创建预约
    async createAppointment(data) {
        let dataObj = Object.assign({
            "appointTime": "",
            "caseId": "",
            "content": "",
            "userId": "",
            "stuId": ""
        }, data)

        let paramsJson = {
            method: 'post',
            url: 'issue/appointment',
            data: dataObj
        }
        let jsondata = await commonService.asyncFetchData(paramsJson)
        return jsondata
    },
    //预约列表
    async getAppointList(data) {
        let dataObj = Object.assign({
            "userId": ""
        }, data)

        let paramsJson = {
            method: 'get',
            url: 'issue/appointment',
            params: dataObj
        }
        let jsondata = await commonService.asyncFetchData(paramsJson)
        return jsondata
    },
    //预约详情
    async getAppointInfo(data) {
        let dataObj = Object.assign({
            "id": ""
        }, data)

        let paramsJson = {
            method: 'get',
            url: 'issue/appointment/' + dataObj.id
        }
        let jsondata = await commonService.asyncFetchData(paramsJson)
        return jsondata
    },
    //预约重复提醒
    async repeatOnce(data) {
        let dataObj = Object.assign({
            "id": ""
        }, data)

        let paramsJson = {
            method: 'get',
            url: 'issue/appointment/' + dataObj.id + '/repeatOnce'
        }
        let jsondata = await commonService.asyncFetchData(paramsJson)
        return jsondata
    },
    //删除预约
    async deleteAppoint(data) {
        let dataObj = Object.assign({
            "id": ""
        }, data)

        let paramsJson = {
            method: 'delete',
            url: 'issue/appointment/' + dataObj.id
        }
        let jsondata = await commonService.asyncFetchData(paramsJson)
        return jsondata
    }

}